package com.cy.pj.sys.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface SysRoleMenuDao {
	/**
	 * 基于菜单id删除角色菜单管理表数据
	 * @param id
	 * @return
	 */
	@Delete("delete from sys_role_menus where menu_id=#{id}")
	int deleteObjectByMenuId(Integer id);
	
	/** 保存角色菜单关系数据 */
	int insertObjects(@Param("roleId") Integer roleId,@Param("menuIds")Integer... menuIds);
	
	/** 基于角色id删除角色与菜单对应关系 */
	@Delete("delete from sys_role_menus where role_id=#{roleId}")
	int deleteObjectByRoleId(Integer roleId);
	
}
